<!-- 
1.属性和方法
2.slot
3.ref
 -->
<template>
    <div class="b-input">
        <el-input ref="elInputRef" v-bind="$attrs" v-on="$listeners">
            <template v-for="(_, name) in $slots" #[name]>
                <slot :name="name"></slot>
            </template>
        </el-input>
    </div>
</template>

<script>
export default {
    inheritAttrs: false,
    name: 'bInput',
    mounted() {
        // console.log(this.$slots)
        // console.log(this.$scopedSlots)

        for (const key in this.$refs.elInputRef) {
            if (typeof this.$refs.elInputRef[key] === 'function' && !['_', '$'].includes(key[0]) && !['constructor'].includes(key)) {
                this[key] = this.$refs.elInputRef[key]
            }
        }
    },
}
</script>

<style lang="scss" scoped></style>